<template>
  <div class="time-select">
    <h3 class="title">服务时间</h3>
    <p class="time-desc">请选择您的预约时间，预约时间最早可选支付完成后4小时，您可选择（含今天）五天内的预约时间。</p>
    <time-picker
      :startTime="startTime"
      :endTime="endTime"
      :timeInterval="0.5"
      :selectedItemColor="'#4ECE40'"
      :selectedTabColor="'#fff'"
      :disableText="'暂不可预约'"
      :advanceTime="0"
      :timeSlot="0.5"
      @selectTime="handleSelectTime"
      @selectDateEvent="handleSelectDate"
    ></time-picker>
    <div class="btn-wrapper">
      <van-button color="#4ECE40" block>确认</van-button>
    </div>
  </div>
</template>

<script>
import TimePicker from "@/components/time-picker/index";
export default {
  data() {
    return {
      startTime: '08:00',
      endTime: '22:30'
    };
  },

  components: {
    TimePicker,
  },

  computed: {},

  methods: {
    handleSelectTime(index,item){
      console.log(index,item,'handleSelect')
    },
    handleSelectDate(index,item){
      console.log(index,item,'handleSelect')
    },
  },
};
</script>
<style lang='less'>
.time-select{
  padding: 15px 0;
  background: #fff;
  .btn-wrapper{
    padding: 10px;
  }
  .title{
    font-size: 16px;
    padding: 0 10px;
    text-align: center;
    margin-bottom: 12px;
  }
  .time-desc{
    font-size: 13px;
    color: #999999;
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 0 10px;
  }
}
</style>